* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Chrome扩展弹窗强制宽度设置 */
html {
    width: 900px !important;
    min-width: 900px !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    width: 900px;
    min-width: 900px;
    margin: 0;
    padding: 0;
}

.container {
    width: 900px;
    min-width: 900px;
    max-width: 900px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.content {
    display: flex;
    min-height: 550px;
    width: 100%;
}

/* 左侧面板 */
.left-panel {
    flex: 1;
    min-width: 250px;
    max-width: 280px;
    padding: 20px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
}

.input-section {
    margin-bottom: 20px;
}

.input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

#textInput {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.quick-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* 中间面板 */
.middle-panel {
    flex: 0 0 200px;
    min-width: 200px;
    max-width: 200px;
    padding: 20px;
    background: white;
    border-right: 1px solid #e9ecef;
}

.settings-section h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.setting-item select,
.setting-item input[type="color"] {
    width: 100%;
    max-width: 100%;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.setting-item select:focus,
.setting-item input[type="color"]:focus {
    outline: none;
    border-color: #667eea;
}

.setting-item input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.setting-item input[type="range"] {
    width: calc(100% - 40px);
    max-width: calc(100% - 40px);
    margin-right: 10px;
    box-sizing: border-box;
}

#marginValue {
    font-weight: 600;
    color: #667eea;
    min-width: 20px;
    display: inline-block;
}

.generate-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

/* 右侧面板 */
.right-panel {
    flex: 1;
    min-width: 350px;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.qr-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    min-height: 350px;
    width: 100%;
}

#qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow: hidden;
}

#qrcode canvas {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
}

#qrcode img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
}

.placeholder {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.placeholder p {
    line-height: 1.5;
}

.download-section {
    display: flex;
    gap: 10px;
}

.download-btn {
    flex: 1;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.download-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.download-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 隐藏状态 */
.hidden {
    display: none !important;
}

/* 响应式设计 - 仅在极小宽度时触发 */
@media (max-width: 600px) {
    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .content {
        flex-direction: column;
        min-height: auto;
    }
    
    .left-panel,
    .middle-panel,
    .right-panel {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        min-width: auto;
    }
    
    .right-panel {
        border-bottom: none;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 成功状态 */
.success {
    background: #28a745 !important;
}

.success:hover {
    background: #218838 !important;
} 